<?php
$css = JURI::base().'modules/mod_jv_twitter/assets/css/jv_twitter.css';
$urlAjax = JURI::base().'modules/mod_jv_twitter/request_ajax.php';
$document = &JFactory::getDocument();
$document->addStyleSheet($css);
$wrapAccordId = 'wrap_twitter_accord'.$module->id;       
$noTwitter = $params->get('no_twitter');
$js = JURI::base().'modules/mod_jv_twitter/assets/js/jv_accordion.js';
$jsSplit = JURI::base().'modules/mod_jv_twitter/assets/js/jv_split_twitter.js';
$document->addScript($js);
$document->addScript($jsSplit);
$isAccord= 0;
if($params->get('show_avatar_header') == 1 || $params->get('show_username_header') == 1){$isAccord = 1;}
$strFollow = $params->get('usernames');
$aryUser = split(',',$strFollow);
?>
<script type="text/javascript">
window.addEvent('domready',function(){   
    var splitTwitter = new JVSplitTwitter({       
        urlAjax:'<?php echo $urlAjax; ?>',
        moduleId:'<?php echo $module->id; ?>',
        wrapAccordId: '<?echo $wrapAccordId; ?>',  
        noTwitter:'<?php echo $noTwitter; ?>',     
        isAccord:<?php echo $isAccord;?>,
        twitterWrap:'jv_wrap_twitter<?php echo $module->id; ?>',            
        isMerge:<?php echo $params->get('merge_twitter'); ?>        
    }); 
    <?php 
    if($params->get('show_avatar_header') == 1 || $params->get('show_username_header') == 1){  
    ?> 
    var twitterAccordion1 = new JVAccordion('div.jv_header_wrapper','div.twitter_content',{
                            opacity: false,
                            alwaysHide:true,
                            firstItem:0,                            
                            onActive:function(toggler,element){ 
                                toggler.setStyle('opacity','1');                               
                            },
                            onBackground:function(toggler,element){
                                toggler.setStyle('opacity','0.5');
                            }                            
                        },
              $('<?echo $wrapAccordId; ?>'));
     <? }?>         
});
</script>
<div style="display: none;"><a href="http://www.joomlavision.com" title="Joomla Templates">Joomla Templates</a> and Joomla Extensions by JoomlaVision.Com</div>
<div id="jv_twitter_follow<?php echo $module->id; ?>" class="twitter_follow">
	<?php foreach($aryUser as $item ) {?>
	<div class="jv_twit_follow">Follow&nbsp;<a href="http://twitter.com/<?php echo $item; ?>"><?php echo $item;?></a> on twitter</div>
	<?php } ?>
</div>
<div class="jv_wrap_twitter twitter-ajax-loading" id="jv_wrap_twitter<?php echo $module->id; ?>">
</div>
